#include <stdio.h>
#include "esp_wifi.h"
#include "esp_netif.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "esp_netif_ip_addr.h"

#include "my_wifi.h"
#include "my_udp.h"
#include "global_event.h"
#include "moto_ctrl.h"
#include "windswing_specific.h"

void initLED();


void app_main(void) {
    init_mcp();
    wifiEventGroup = xEventGroupCreate();
    initNvs();
    initUDPTaskManager();
    initWindSwing();
    initLED();
    initWifi();

    //xTaskCreate(task_Computer, "task_Computer", 2048, NULL, 2, NULL);

    vTaskDelete(NULL);
}

void initLED(){
    gpio_config_t gpioConfig = {
        .mode = GPIO_MODE_OUTPUT,
        .pin_bit_mask = BIT(2),
    };
    gpio_config(&gpioConfig);
//    gpio_set_level(GPIO_NUM_2, 1);
}